package com.chry.ocr.service.amqp;
import javax.annotation.Resource;
import org.apache.log4j.Logger;
import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.chry.ocr.testmybatis.TestMyBatis;
@Service
public class MessageProducer {

	private static Logger logger = Logger.getLogger(TestMyBatis.class);
	//@Resource(name="amqpTemplate")
	@Autowired
	private AmqpTemplate amqpTemplate;
	/*@Resource(name="amqpTemplate2")
	private AmqpTemplate amqpTemplate2;*/
	
	public void sendMessage(Object message){
		logger.info("to send message:{}" + message);
		amqpTemplate.convertAndSend("queueTestKey",message);
		amqpTemplate.convertAndSend("queueTestChris", message);
		
	}
}
